layui.define(['jquery','element','scrollReveal'], function (exports) {
	var moduleName = 'index';
	var $ = layui.jquery;
	var element = layui.element;
	var scrollReveal = layui.scrollReveal;
	var $doc = $(document);
	var animate = new scrollReveal({ reset: false, move: '100px'})
	
	$doc.on('focus','.search-input',function(){
		var val = $(this).val();
		if(!val) $('.search-tips').hide();
	}).on('blur','.search-input',function(){
		var val = $(this).val();
		if(!val) $('.search-tips').show();
	})
	$doc.on('click','.nav-item',function(){
		$(this).addClass('active').siblings().removeClass('active')
	})
	element.on('tab(section)',function(){
		animate.init();
	})
	// 返回顶部
	$doc.on('click','.back-top',function(){
		$('html').animate({
			scrollTop:0
		},300)
	})
	
	exports(moduleName)
})